<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php");// 引入通用的设置文件 ?>
<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("../controller/data_add.php");// 当前页面的控制器 ?>
<?php include_once("module/mod-nkeditor.php");// 富文本编辑框 ?>
<body>
<!--顶部栏-->
<div id="topbar"> <?php include $_SERVER['DOCUMENT_ROOT'].'/controller/common/module/topbar.php'; ?></div>
<!--容器-->
<div id="container" class="<? echo $now_extender ?>">
    <!--侧边栏-->
    <div id="sidebar"><?php include $_SERVER['DOCUMENT_ROOT'].'/controller/common/module/sidebar.php'; ?></div>
    <!--主内容-->
    <div id="content">
        <!--标题设定-->
        <?php $page_title='添加';?>
        <?php include $_SERVER['DOCUMENT_ROOT'].'/controller/common/module/mod-page-title.php'; ?>
        <?//============================================?>
        <?//以下开发需要注重的部分，主要写前端?>
        <?//============================================?>







           <div class="detail-box">
               <ul class="detail-boxing">
                   <form id="data_form" method="post" class="layui-form"
                         action ="data_add_process.php?<? echo $data['url_parameter'] ?>"
                         enctype="multipart/form-data">

                       <input type="hidden"  name="nid" value="<? echo $data['data_detail']['nid']?>" >

                       <fieldset class="layui-elem-field layui-field-title" >
                           <legend>基本信息</legend>
                       </fieldset>

                       <blockquote class="layui-elem-quote">基本信息多数是对外使用的资料，请细心填写。</blockquote>
                       <br/>


                       <!--普通的input文本输入-->
                       <li class="layui-form-item name">
                           <label class="layui-form-label">名称：</label>
                           <div class="layui-input-block">
                               <input type="text" class="layui-input"  name="ai_title"  value="<? echo $data['data_detail']['title'] ?>">
                               <em class="explain">(<u style="color:red">*必填项目</u>, 填写标题) </em>
                           </div>
                       </li>



                       <!--普通的textarea多行文本输入-->
                       <li class="layui-form-item introduce">
                           <label class="layui-form-label">简介：</label>
                           <div class="layui-input-block">
                               <textarea class="layui-textarea" name="ai_introduce"  ><?echo  $data['data_detail']['introduce']?></textarea>
                               <em class="explain">(填写本文的概述)</em>
                           </div>
                       </li>

                       <!--单张图片的上传，需要优化-->
                       <? include("module/mod-image-upload.php");?>



                       <div class="layui-form-item">
                           <label class="layui-form-label">标签</label>
                           <div class="layui-input-block" >
                               <? foreach ($tag_array as $k => $v){?>
                                   <input type="checkbox" name="ai_rank[]"  value="<?echo $v?>"     title="<?echo $v?>"
                                       <? if(in_array($v,$now_tag_array))   {echo "checked";} ?>>
                                   <?;}?>
                           </div>

                       </div>



                       <!--富文本编辑框-->
                        <li class="layui-form-item detail">
                            <label class="layui-form-label">资料详情：</label>
                                <div class="layui-input-block">
                                    <textarea name="ai_detail" style="width:1000px;height:400px;visibility:hidden;"><? echo $data['data_detail']['detail'] ?></textarea>
                                    <em class="explain">(填写详细页面文字、图片等主体内容)</em>
                                </div>
                        </li>





                       <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;" id="content3">
                           <legend>更多资料</legend>
                       </fieldset>

                       <br/>




                       <!--单选项-->
                       <li class="layui-form-item publish">
                           <label class="layui-form-label">发布状态：</label>
                           <div class="layui-input-block">
                               <input name='ai_publish' type='radio' value='1' title="立即发布"
                                   <? if ($data['data_detail']['publish'] == '1') {echo "checked='checked'";} ?>/>
                               <input name='ai_publish' type='radio' value='0' title="暂未发布"
                                   <? if ($data['data_detail']['publish'] == '0') {echo "checked='checked'";} ?>/>
                               <em class="explain">(选择立即发布，以上信息才能在前台显示；选择暂未发布，只对以上信息进行保存，不在前台显示)</em>
                           </div>
                       </li>



                       <!--时间选择-->
                       <li class="layui-form-item inputtime">
                           <label class="layui-form-label">发布时间：</label>
                           <div class="layui-input-block">
                               <input type="text" class="laydate-icon laydate layui-input"
                                      name="ai_date" required
                                      value="<? echo date("Y-m-d H:i:s"); ?>"
                                       >
                               <em class="explain">(填写发布的时间)</em>
                          </div>
                       </li>




                       <div class="function">
                           <button class="layui-btn"  lay-submit type="submit" >立即提交</button>
                           <input type="reset" class="layui-btn" value="重置"/>

                           <a 	class="layui-btn layui-btn-normal" href="#content1" style="margin-left: 35px">基本信息</a>
                           <a 	class="layui-btn layui-btn-normal" href="#content2">SEO设置</a>
                           <a href="javascript:;" class="layui-btn layui-bg-red layui-icon layui-icon-top go_top"></a>
                       </div>



                   </form>
               </ul>
           </div>







        <?//============================================?>
        <?//以下JS部分需要根据实际情况去加载?>
        <?//============================================?>

    </div>
    <!--content end-->
<br class="clearfloat"/>
<!--container  end-->
</div>

<?//============================================?>
<?//JS加载区域?>
<?//============================================?>
<script>
</script>




<!--底部栏-->
<?php include $_SERVER['DOCUMENT_ROOT']."/controller/common/module/footer.php"; ?>

